package com.hksj.common.core.enums;

public enum DeviceProductState {
    unregistered("未发布", (byte) 0),
    registered("已发布", (byte) 1),
    other("其它", (byte) -100),
    forbidden("禁用", (byte) -1);

    private String text;

    private Byte value;

    DeviceProductState(String text, Byte value) {
        this.text = text;
        this.value = value;
    }

    public String getName() {
        return name();
    }

    public String getValue() {
        return name();
    }

    public String getText(String name){
        for (DeviceProductState productState : DeviceProductState.values()) {
            if (productState.name().equals(name)) {
                return productState.text;
            }
        }
        return null;
    }
}
